{extend name="common/base"/}
{block name="style"}
{/block}
{block name="body"}
{php}
$site_title = '提现记录';
{/php}
{include file="common/header"/}
<style>
.list .bui-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.list .bui-btn i {
    font-size: .5rem;
}
.list .bui-btn .fa-check-circle-o {
    color:#03d1a1;
}
.list .bui-btn .fa-close {
    color:#a70000;
}
.list .bui-btn .fa-clock-o {
    color:#8a8a8a;
}
.list .bui-btn .span1 {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
}
.list .bui-btn .span1 .item-text {
    margin-right: .1rem;
    margin-bottom: 0;
    color: #333;
}
.list .bui-btn .span1 h3 {
    clear: both;
    display: block;
}
</style>
<div class="list">
    <ul class="bui-listview" b-template="log.tplLog(log.list)">
        
    </ul>
</div>
{/block}
{block name="script"}
<script>
    bui.ready(function () {
        $(".bui-navbar").hide();
        $(".footer").hide();
        $(".bui-bar-right").css('visibility', 'hidden');

        var bs = bui.store({
            el: ".bui-page",
            scope: "log",
            data: {
                list: {}
            },
            methods: {
                log: function (e) {
                    var that = this;
                    post("{:furl('v1/withdrawlog', [], true, 'api')}", {}, function (result) {
                        if (result.code == 0) {
                            that.list = result.data || [];                            
                        } else {
                            bui.hint(result.msg);
                        }
                    });
                },               
            },
            watch: {},
            computed: {},
            templates: {
                tplLog(data) {
                    let html = "";
                    if(data && data.length > 0) {
                        data.forEach((item, index) => {
                            html += `<li>
                                        <div class="bui-btn">                                            
                                            <div class="span1">                                                
                                                <p class="item-text">提现钱数：${item.money}天</p>
                                                <p class="item-text">扣除税点：${item.tax}元</p>
                                                <p class="item-text">金币数量：${item.coin}</p>                                                
                                                <p class="item-text">提现时间：${item.create_time}</p>`                                                
                                                if(item.status == 1) {
                                                    html += `<p class="item-text">提现状态：提现成功</p>`
                                                }
                                                if(item.status == 0) {
                                                    html += `<p class="item-text">提现状态：审核中</p>`
                                                }
                                                if(item.status == 2) {
                                                    html += `<p class="item-text">提现状态：提现拒绝</p>`
                                                }
                                                if(item.notes) {
                                                    html += `<h3 class="item-text">提现备注：${item.notes}</h3>`
                                                }
                                            html += `</div>`
                                            if(parseInt(item.status) == 1) {
                                                html += `<i class="fa fa-check-circle-o" aria-hidden="true"></i>`                                                
                                            }
                                            if(parseInt(item.status) == 2) {
                                                html += `<i class="fa fa-close" aria-hidden="true"></i>`
                                            }
                                            if(parseInt(item.status) == 0) {
                                                html += `<i class="fa fa-clock-o" aria-hidden="true"></i>`
                                            }
                                        html += `</div>
                                    </li>`;
                        })
                    }
                    return html;
                },
            },
            mounted: function () {
                this.log();               
            }
        });
    })
</script>
{/block}